<!DOCTYPE HTML>
<html>
<head th:include="/common/head :: head"></head>

<body class="pos-r">
	<div>

		<nav class="breadcrumb"
			th:include="/common/navbar :: navbar('用户管理','首页')"></nav>

		<div class="page-container">
			<div class="mt-20">
				<table
					class="table table-border table-bordered table-bg table-hover table-sort">
					<thead>
						<tr class="text-c">
							<th width="40">账号</th>
							<th width="40">姓名</th>
							<th width="60">手机号</th>
							<th width="60">地址</th>
							<th width="100">职务</th>
							<th width="100">用户类型</th>
							<th width="100">操作</th>
						</tr>
					</thead>
					<tbody>
						<tr class="text-c va-m" th:each="vo,voStat : ${list}">
							<td class="text-l"><a style="color:blue" th:href="@{/user/checkUser(id=${vo.id})}" th:text="${vo.userCode}"></a></td>
							<td class="text-l" th:text="${vo.name}"></td>
							<td class="text-l" th:text="${vo.mobile}"></td>
							<td class="text-l" th:text="${vo.provinceEntity!=null? vo.provinceEntity.name+vo.cityEntity.name+vo.districtEntity.name:''}"></td>
							<td class="text-l" th:text="${vo.position}"></td>
							<td class="text-l" th:text="${vo.userType != null} ? ${vo.userType.value} :  '' "></td>
							<td class="text-l" > <a class="btn" th:href="@{/user/checkUser(id=${vo.id})}"> 查看</a></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
	</div>


	<script type="text/javascript"
		src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>


	<script type="text/javascript">
		//初始化表格
		$('.table-sort').dataTable({
			"aaSorting" : [ [ 1, "desc" ] ],//默认第几个排序
			"bStateSave" : true,//状态保存
			"aoColumnDefs" : [ {
				"orderable" : false,
				"aTargets" : [ 6 ]
			} // 制定列不参与排序
			]
		});

		var $table = $('.table-sort').DataTable();

		//消除缓存带来的影响，获取全部表格数据
		$(function() {
			$('.table-sort').DataTable().columns(5).search("").draw();
		})
	</script>
</body>
</html>